package br.cin.ufpe.corba;


public class ObjectAddress extends ORBAddress {

	private static final long serialVersionUID = 8509865655708399146L;
	
	private String key;
	
	public ObjectAddress(String host, int port, String objectName) {
		super(host, port);
		this.setKey(objectName);
	}

	public ObjectAddress(ORBAddress address, String objectName){
		this(address.getHost(), address.getPort(), objectName);
	}

	public void setKey(String objectName) {
		this.key = objectName;
	}

	public String getKey() {
		return key;
	}
	
	public boolean equals(Object obj) {
		return super.equals(obj) && (this.key.equals(((ObjectAddress)obj).key));
	}
}
